class AlterQuestionTextTable < ActiveRecord::Migration
  def self.up
    remove_column :question_texts, :by_country
    remove_column :question_texts, :by_cross_border
    remove_column :question_texts, :by_strategy
    remove_column :question_texts, :autofill_country
    remove_column :question_texts, :autofill_cross_border
    remove_column :question_texts, :autofill_strategy
    rename_table :question_texts, :question_by_roles 
    add_column :question_by_roles, :first_column, :string, :limit => 4, :default => 'yes'
    add_column :question_by_roles, :columns_by_xb, :string, :limit => 4, :default => 'no'
  end

  def self.down
    remove_column :question_by_roles, :first_column
    remove_column :question_by_roles, :columns_by_xb
    rename_table :question_by_roles, :question_texts
    add_column :question_texts, :by_country
    add_column :question_texts, :by_cross_border
    add_column :question_texts, :by_strategy
    add_column :question_texts, :autofill_country
    add_column :question_texts, :autofill_cross_border
    add_column :question_texts, :autofill_strategy
  end
end
